<?php

class FeedbackController extends Controller
{
    private $model;
    function __construct()
    {
        $this->loadLibrary('Utility');
        $this->loadLibrary('Session');
        $this->model = $this->loadModel('feedback');
    }

    public function index()
    {
        $fbs = $this->model->getFeedbackList();
        //var_dump($albums);
        $view = $this->loadView('feedback');
        if (count($fbs)>0) $view->appendBlockData(array('fbs'=>$fbs));
        $view->setBlockData("Quản lí các góp ý - liên hệ","main_header");
        $view->render();
    }

    public function delete($id)
    {
        $this->model->delete($id);
        $fbs = $this->model->getFeedbackList();
        $view = $this->loadView('feedback');
        if (count($fbs)>0) $view->appendBlockData(array('fbs'=>$fbs));
        $view->setBlockData("Quản lí các góp ý - liên hệ","main_header");
        $view->render();
    }
}